package structural.flyweight;

/**
 * @Description: 测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class FlyWeightTest {
    public static void main(String[] args) {
        Car porsche = new Car("保时捷", "白色");
        CarFactory.putCat("1", porsche);

        Car lamborghini = new Car("兰博基尼","黑色");
        CarFactory.putCat("2", lamborghini);

        CarFactory.getCar("1").run();
        CarFactory.getCar("2").run();
    }
}
